import pandas as pd


def test01():
    data = [[90, 2, 10, 40],
            [60, 4, 15, 45],
            [75, 3, 13, 46],
            [78, 2, 64, 22]]
    data = pd.DataFrame(data)
    print("数据集:\n", data)
    print("*" * 30)
    # 产生训练集
    train = data.sample(frac=1, replace=True)
    print("训练集:\n", train)
    print("*" * 30)
    #测试集
    test = data.loc[data.index.difference(train.index)]
    print("测试集:\n", test)

if __name__ == '__main__':
    test01()